<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="../template/index.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<ui:define name="title">
		<title>Human Resource</title>
		<script>
			$('document').ready(function() {
				$('#candidate-id').addClass("menu-left-selected");
				var item = $('#candidate-id').next('li').find("ul");
				if (item == null) {
					return;
				}
				item.css({
					"display" : "block"
				});
			});
		</script>
	</ui:define>
	<ui:define name="lcontent">
		<ui:include src="../template/menu-left/human-resources.xhtml"></ui:include>
	</ui:define>
	<ui:define name="rcontent">
		<h:form id="form">
			<f:event type="preRenderView"
				listener="#{employeeManagement.onloadCandidateManagement}" />
			<div class="control">
				<div class="control-button">
					<a
						href="#{facesContext.externalContext.requestContextPath}/human-resources/add-new-candidate.html">
						<img
						src="#{facesContext.externalContext.requestContextPath}/resources/images/icon/plus.png" />
						<span>#{msg['add-new']}</span> </a>
				</div>
				<span class="clear"></span>
			</div>
			<div class="rcontent-main">
				<div class="loading">
					<img
						src="#{facesContext.externalContext.requestContextPath}/resources/images/loading.gif" />
				</div>
				<div class="main-content-table-panel">
					<table class="main-content-table">
						<tr>
							<th>#{msg['lastname']}</th>
							<th>#{msg['firstname']}</th>
							<th>#{msg['gender']}</th>
							<th>#{msg['birthday']}</th>
							<th>#{msg['phone']}</th>
							<th>#{msg['email']}</th>
						</tr>
						<ui:repeat var="item" value="#{employeeManagement.listCandidate}">
							<tr>
								<td>
									<h:commandLink value="#{item.ltne}" styleClass="click"
										actionListener="#{employeeManagement.clickToEditCandidate}">
										<f:attribute value="#{item}" name="object"></f:attribute>
									</h:commandLink>
								</td>
								<td>
									<h:commandLink value="#{item.ftne}" styleClass="click"
										actionListener="#{employeeManagement.clickToEditCandidate}">
										<f:attribute value="#{item}" name="object"></f:attribute>
									</h:commandLink>
								</td>
								<td>
									<h:commandLink value="#{msg['male']}" rendered="#{item.sx == 1}" styleClass="click"
										actionListener="#{employeeManagement.clickToEditCandidate}">
										<f:attribute value="#{item}" name="object"></f:attribute>
									</h:commandLink>
									<h:commandLink value="#{msg['female']}" rendered="#{item.sx == 2}" styleClass="click"
										actionListener="#{employeeManagement.clickToEditCandidate}">
										<f:attribute value="#{item}" name="object"></f:attribute>
									</h:commandLink>
								</td>
								<td>
									<h:commandLink styleClass="click"
										actionListener="#{employeeManagement.clickToEditCandidate}">
										<h:outputText value="#{item.bhdy}">
											<f:convertDateTime pattern="dd/MM/yyyy"></f:convertDateTime>
										</h:outputText>
										<f:attribute value="#{item}" name="object"></f:attribute>
									</h:commandLink>
								</td>
								<td>
									<h:commandLink value="#{item.penmbr}" styleClass="click"
										actionListener="#{employeeManagement.clickToEditCandidate}">
										<f:attribute value="#{item}" name="object"></f:attribute>
									</h:commandLink>
								</td>
								<td>
									<h:commandLink value="#{item.el}" styleClass="click"
										actionListener="#{employeeManagement.clickToEditCandidate}">
										<f:attribute value="#{item}" name="object"></f:attribute>
									</h:commandLink>
								</td>
							</tr>
						</ui:repeat>
					</table>
				</div>
			</div>
		</h:form>
	</ui:define>
</ui:composition>